package cn.xfdzx.android.apps.shop.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import java.io.File;
import java.util.ArrayList;

import cn.xfdzx.android.apps.shop.R;

/**
 * @author gzk
 * @date 2020/3/28 0028
 * description：地图选择
 */
public class SelectMapLVAdapter extends BaseAdapter {

    private Context mContext;
    private ArrayList<String> mList;


    private TextView tv_select_map;



    public SelectMapLVAdapter(Context mContext, ArrayList<String> mList) {
        this.mContext = mContext;
        this.mList = mList;

    }


    @Override
    public int getCount() {
        return mList.size();
    }

    @Override
    public Object getItem(int i) {
        return i;
    }

    @Override
    public long getItemId(int i) {
        return 0;
    }

    @Override
    public View getView(final int i, View view, ViewGroup viewGroup) {
        view = View.inflate(mContext, R.layout.item_select_map, null);
        tv_select_map = view.findViewById(R.id.tv_select_map);


        if ("com.baidu.BaiduMap".equals(mList.get(i))) {
            tv_select_map.setText("百度地图");
        } else if ("com.autonavi.minimap".equals(mList.get(i))) {
            tv_select_map.setText("高德地图");
        } else if ("com.tencent.map".equals(mList.get(i))) {
            tv_select_map.setText("腾讯地图");
        }


        return view;
    }
}
